package translated;

import java.util.List;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.jet.util.*;

public class ActivatorGen
{
  protected static String nl;
  public static synchronized ActivatorGen create(String lineSeparator)
  {
    nl = lineSeparator;
    ActivatorGen result = new ActivatorGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "/**" + NL + " * Copyright (c) Software Institute of PKU" + NL + " * All rights reserved. " + NL + " * This program and the accompanying materials" + NL + " * are made available under the terms of the Eclipse Public License v1.0" + NL + " * which accompanies this distribution, and is available at" + NL + " * http://www.eclipse.org/legal/epl-v10.html" + NL + " *" + NL + " */" + NL + "package ";
  protected final String TEXT_2 = ";" + NL + "" + NL + "import org.eclipse.jface.resource.ImageDescriptor;" + NL + "import org.eclipse.ui.plugin.AbstractUIPlugin;" + NL + "import org.osgi.framework.BundleContext;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " * The activator class controls the plug-in life cycle" + NL + " */" + NL + "public class ";
  protected final String TEXT_3 = " extends AbstractUIPlugin {" + NL + "" + NL + "\t// The plug-in ID" + NL + "\tpublic static final String PLUGIN_ID = \"";
  protected final String TEXT_4 = "\";" + NL + "" + NL + "\t// The shared instance" + NL + "\tprivate static ";
  protected final String TEXT_5 = " plugin;" + NL + "" + NL + "\t/**" + NL + "\t * The constructor" + NL + "\t */" + NL + "\tpublic ";
  protected final String TEXT_6 = "() {" + NL + "\t\tplugin = this;" + NL + "\t}" + NL + "" + NL + "\t/*" + NL + "\t * (non-Javadoc)" + NL + "\t * " + NL + "\t * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)" + NL + "\t */" + NL + "\tpublic void start(BundleContext context) throws Exception {" + NL + "\t\tsuper.start(context);" + NL + "\t}" + NL + "" + NL + "\t/*" + NL + "\t * (non-Javadoc)" + NL + "\t * " + NL + "\t * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)" + NL + "\t */" + NL + "\tpublic void stop(BundleContext context) throws Exception {" + NL + "\t\tplugin = null;" + NL + "\t\tsuper.stop(context);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the shared instance" + NL + "\t * " + NL + "\t * @return the shared instance" + NL + "\t */" + NL + "\tpublic static ";
  protected final String TEXT_7 = " getDefault() {" + NL + "\t\treturn plugin;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns an image descriptor for the image file at the given plug-in" + NL + "\t * relative path" + NL + "\t * " + NL + "\t * @param path" + NL + "\t *            the path" + NL + "\t * @return the image descriptor" + NL + "\t */" + NL + "\tpublic static ImageDescriptor getImageDescriptor(String path) {" + NL + "\t\treturn imageDescriptorFromPlugin(PLUGIN_ID, path);" + NL + "\t}" + NL + "" + NL + "\tpublic static String getPluginId() {" + NL + "\t\treturn getDefault().getBundle().getSymbolicName();" + NL + "\t}" + NL + "}";
  protected final String TEXT_8 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     String bundleID = (String) argument; 
    stringBuffer.append(TEXT_1);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.bundleBase);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(ModelerConstants.activatorName);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(bundleID);
    stringBuffer.append(TEXT_4);
    stringBuffer.append(ModelerConstants.activatorName);
    stringBuffer.append(TEXT_5);
    stringBuffer.append(ModelerConstants.activatorName);
    stringBuffer.append(TEXT_6);
    stringBuffer.append(ModelerConstants.activatorName);
    stringBuffer.append(TEXT_7);
    stringBuffer.append(TEXT_8);
    return stringBuffer.toString();
  }
}
